package org.ycx.doc.dao.auto;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;
import org.ycx.doc.dao.model.DocModulePage;
import org.ycx.doc.dao.model.DocModulePageExample;

public interface DocModulePageMapper {
    @SelectProvider(type=DocModulePageSqlProvider.class, method="countByExample")
    long countByExample(DocModulePageExample example);

    @DeleteProvider(type=DocModulePageSqlProvider.class, method="deleteByExample")
    int deleteByExample(DocModulePageExample example);

    @Delete({
        "delete from doc_module_page",
        "where MODULE_ID = #{moduleId,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer moduleId);

    @Insert("insert into doc_module_page(module_id,content) values(#{moduleId},#{content})")
    int insert(DocModulePage record);

    @Insert("insert into doc_module_page(MODULE_ID,CONTENT)values(#{moduleId},#{content})")
    int insertSelective(DocModulePage record);

    @SelectProvider(type=DocModulePageSqlProvider.class, method="selectByExampleWithBLOBs")
    @Results({
        @Result(column="MODULE_ID", property="moduleId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="CONTENT", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<DocModulePage> selectByExampleWithBLOBs(DocModulePageExample example);

    @SelectProvider(type=DocModulePageSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="MODULE_ID", property="moduleId", jdbcType=JdbcType.INTEGER, id=true)
    })
    List<DocModulePage> selectByExample(DocModulePageExample example);

    @Select({
        "select",
        "MODULE_ID, CONTENT",
        "from doc_module_page",
        "where MODULE_ID = #{moduleId,jdbcType=INTEGER}"
    })
    @Results({
        @Result(column="MODULE_ID", property="moduleId", jdbcType=JdbcType.INTEGER, id=true),
        @Result(column="CONTENT", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    DocModulePage selectByPrimaryKey(Integer moduleId);

    @UpdateProvider(type=DocModulePageSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") DocModulePage record, @Param("example") DocModulePageExample example);

    @UpdateProvider(type=DocModulePageSqlProvider.class, method="updateByExampleWithBLOBs")
    int updateByExampleWithBLOBs(@Param("record") DocModulePage record, @Param("example") DocModulePageExample example);

    @UpdateProvider(type=DocModulePageSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") DocModulePage record, @Param("example") DocModulePageExample example);

    @UpdateProvider(type=DocModulePageSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(DocModulePage record);

    @Update({
        "update doc_module_page",
        "set CONTENT = #{content,jdbcType=LONGVARCHAR}",
        "where MODULE_ID = #{moduleId,jdbcType=INTEGER}"
    })
    int updateByPrimaryKeyWithBLOBs(DocModulePage record);
}